BufferSize=8

Head=0
Tail=6

print (Head-Tail)%BufferSize

print (Head-1)%BufferSize